package cn.chengpengper.seckill.order.infrastructure.mapper;

import cn.chengpengper.seckill.order.domain.model.entity.SeckillOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chengpeng.hu
 */
public interface SeckillGoodsOrderMapper {

    /**
     * 保存订单
     *
     * @param seckillOrder 订单
     * @return 影响行数
     */
    int saveSeckillOrder(SeckillOrder seckillOrder);

    /**
     * 根据商品ID获取订单列表
     *
     * @param goodsId 商品ID
     * @return 订单列表
     */
    List<SeckillOrder> getSeckillOrderByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * 删除订单
     *
     * @param goodsId 商品ID
     * @param orderId 订单ID
     */
    void deleteOrder(@Param("goodsId") Long goodsId, @Param("orderId") Long orderId);
}
